package com.xcf.service.business.finance.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.service.business.finance.BusinessAccountApplyService;
import com.xcf.util.PageData;
@Service
public class BusinessAccountApplyServiceImpl implements BusinessAccountApplyService{
	@Resource
	private DaoSupport dao;
	@Override
	public List<Map> findBusinessAccountApply(PageData pd) throws Exception {
		
		return (List<Map>) dao.findForList("businessAccountApply.findLoanDetail", pd);
	}
	@Override
	public void saveBusinessAccountApply(PageData pd) throws Exception {
		dao.save("businessAccountApply.saveInfo", pd);
		
	}
	@Override
	public List<Map> findRecordDetail(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("businessAccountApply.findRecordDetail", pd);
	}
	@Override
	public List<Map> findRecordInfo() throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("businessAccountApply.findRecord", null);
	}
	@Override
	public void updateState(PageData pd) throws Exception {
		dao.update("businessAccountApply.updateState", pd);
	}
	@Override
	public List<Map> findRecordData() throws Exception {
		
		return (List<Map>) dao.findForList("businessAccountApply.findRecordInfo", null);
	}
	@Override
	public void saveCostLoanInfo(List<Map> list) throws Exception {
		dao.batchSave("businessAccountApply.saveCostLoanDetail", list);
		
	}
	@Override
	public List<Map> findIncomeInfo(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("businessAccountApply.findIncomeDetail", pd);
	}
	@Override
	public Object getAppCode(PageData pd) throws Exception {
		
		dao.findForObject("businessAccountApply.getAppCode", pd);
		return ((Map<String,Object>)pd.get("pd")).get("app_code");
	}
	@Override
	public void deleteCostInfoLoan(String bill_code) throws Exception {
		dao.delete("businessAccountApply.deleteCostInfoLoan", bill_code);
		
	}
	@Override
	public PageData findCostInfoLoanByBillCode(String bill_code) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) dao.findForObject("businessAccountApply.findLoanInfo", bill_code);
	}
	@Override
	public List<Map> findAppCodeInfo() throws Exception {
		
		return (List<Map>) dao.findForList("businessAccountApply.findAppCodeInfo", null);
	}
	@Override
	public List<Map> findReceivablesCostInfo(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("businessAccountApply.findReceivablesCostInfo", pd);
	}
	@Override
	public PageData findReceivablesCostDetail(PageData pd) throws Exception {
		
		return (PageData) dao.findForObject("businessAccountApply.findReceivablesCostDetail", pd);
	}
	@Override
	public void saveReceivablesCostDetailRecord(PageData pd) throws Exception {
		dao.save("businessAccountApply.saveReceivablesCostDetailRecord", pd);
	}
	@Override
	public void deleteReceivablesCostDetailRecord(PageData pd) throws Exception {
		dao.delete("businessAccountApply.deleteReceivablesCostDetailRecord", pd);
		
	}
	@Override
	public void saveReceivablesCost(PageData pd) throws Exception {
		dao.save("businessAccountApply.saveReceivablesCost", pd);
		
	}
	@Override
	public void saveReceivablesCostDetail(PageData pd) throws Exception {
		dao.save("businessAccountApply.saveReceivablesCostDetail", pd);
		
	}
//	public void saveReceivablesCostDetail(List<Map> list) throws Exception {
//		dao.batchSave("businessAccountApply.saveReceivablesCostDetail", list);
//		
//	}
	@Override
	public List<Map> findRecordDetailByAppCode(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (List<Map>) dao.findForList("businessAccountApply.findRecordDetailByAppCode", pd);
	}
}
